package start.spring.basic.flowable.enums.flowable;

import lombok.Getter;
import start.spring.basic.ry.core.utils.StringUtils;

/**
 * @author konbai
 * @since 2023/3/9 00:45
 */
@Getter
public enum ProcessStatus {

    /**
     * 进行中（审批中）
     */
    RUNNING("running", "审批中"),
    /**
     * 已终止
     */
    TERMINATED("terminated", "已终止"),
    /**
     * 已完成
     */
    COMPLETED("completed", "已完成"),
    /**
     * 已取消
     */
    CANCELED("canceled", "已取消");

    private final String status;
    
    private final String remark;
    
    ProcessStatus(String status, String remark){
    	this.status = status;
        this.remark = remark;
    }

    public static ProcessStatus getProcessStatus(String str) {
        if (StringUtils.isNotBlank(str)) {
            for (ProcessStatus value : values()) {
                if (StringUtils.equalsIgnoreCase(str, value.getStatus())) {
                    return value;
                }
            }
        }
        return null;
    }
}
